
class TopoNode {
    constructor() {
        this.id = 0;
        this.x = 0;
        this.y = 0;
        this.refID = 0;//关联图形的UUID，不是GID，是RID
    }

    translateSubInfo(tx,ty){
        this.x += tx;
        this.y += ty;
    }

    toJson() {
        var jsonobj = {};
        jsonobj["id"] = this.id;
        jsonobj["x"] = this.x;
        jsonobj["y"] = this.y;
        jsonobj["refID"] = this.refID;
        jsonobj["connLineStr"] = this.connLineStr;
        return jsonobj;
    }
    fromJson(obj) {
        this.id = obj["id"];
        this.x = obj["x"];
        this.y = obj["y"];
        this.refID = obj["refID"];
        this.connLineStr = obj["connLineStr"];
    }

    cloneCopy() {
        var pNewInfo = new TopoNode();
        pNewInfo.id = this.id;
        pNewInfo.x = this.x;
        pNewInfo.y = this.y;
        pNewInfo.refID = this.refID;
        pNewInfo.connLineStr = this.connLineStr;
        return pNewInfo;
    }
}

export default { TopoNode }